/*
 * Copyright (C) 2012 BARBOTIN Nicolas
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef GC_H
#define GC_H

#include <QtGui>
#include "GCProject.h"
#include "GCDataReader.h"
#include "GCOptionsWindow.h"

namespace Ui {
    class GameGen;
}

class GameGen : public QMainWindow
{
    Q_OBJECT

public:
    GameGen(QWidget *parent = 0);
    ~GameGen();

protected:
    void closeEvent(QCloseEvent *e);

private:
    Ui::GameGen *ui;
    QList<GCProject*> projects;
    QList<QTreeWidgetItem*> projectsNode;
    GCDataReader *dataReader;
    GCOptionsWindow *optionsWin;

    void moveWindowToCenter();
    void save(bool as = false);
    int getProject();
    void compileProject(bool r);

private slots:
    void newProject();
    void openHelp();
    void openAboutWindow();
    void openLink(QString link);
    void openProject();
    void saveProject();
    void saveProjectAs();
    void projectRemoved();
    void compileAndRun();
    void build();
    void run();
    void showOptions();
};

#endif // GC_H
